;---------------------------------------------------------------------------
;Kraid Stand Summon (Entrance)
[Statedef 7000]
type    = A
movetype= I
physics = N
velset = Cond(root,FrontEdgeDist > 50,(ParentDist X+20)/15,(ParentDist X-20)/15),-3.83*const(size.yscale)
ctrl = 0
anim = 7000
sprpriority = 3

[State 7000, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7000, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7000, 3]
type = Null
trigger1 = !Time
var(7) = -100-(50*(root,Var(0) > 0))

[State 7000, 4]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 7000, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7000, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7000, 7]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7000, 8]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7001
;---------------------------------------------------------------------------
;Kraid Stand Summon (Shoot)
[Statedef 7001]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7001
sprpriority = 3

[State 7001, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7001, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7001, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7001, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7001, 5]
type = VarSet
trigger1 = Time = 9
fvar(3) = root,FVar(21)

[State 7001, 6]
type = Helper
trigger1 = Time = 9
name = "Spike"
ID = 7050
stateno = 7002
pos = ceil(27*const(size.xscale)),ceil(-42*const(size.yscale))
postype = p1 
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7001, 7]
type = Helper
trigger1 = Time = 12
name = "Spike"
ID = 7051
stateno = 7002
pos = ceil(29*const(size.xscale)),ceil(-32*const(size.yscale))
postype = p1 
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7001, 8]
type = Helper
trigger1 = Time = 15
name = "Spike"
ID = 7052
stateno = 7002
pos = ceil(33*const(size.xscale)),ceil(-24*const(size.yscale))
postype = p1 
facing = 1
keyctrl = 0
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7001, 9]
type = ParentVarSet
trigger1 = Time = 9
var(39) = 1

[State 7001, 10]
type = VarAdd
trigger1 = Time = 9 || Time = 12 || Time = 15
var(11) = 1

[State 7001, 11]
type = PosSet
trigger1 = !Time
y = 0

[State 7001, 12]
type = ChangeState
trigger1 = !AnimTime
value = 7004
;---------------------------------------------------------------------------
;Spike
[Statedef 7002]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7002
sprpriority = 3

[State 7002, 1]
type = HitBy
trigger1 = 1
value = SCA,AP 
time = -1

[State 7002, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7003
time = -1

[State 7002, 3]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(30*parent,Fvar(3)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = S6001
sparkxy = 0,0
hitsound = F5,2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -6.2*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
;fall = 1
;fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7002, 3]
type = VelSet
trigger1 = Time = 15
x = 7.6*const(size.xscale)

[State 7002, 4]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(!Var(26), Var(26) := 3,0)
ignorehitpause = 1

[State 7002, 5]
type = ParentVarSet
trigger1 = MoveHit != 1
var(1) = 0
ignorehitpause = 1

[State 7002, 6]
type = PlaySnd
trigger1 = !Time
value = S195,0

[State 7002, 7]
type = PlaySnd
trigger1 = Time = 15
value = S1000,0

[State 7002, 8]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7003
;---------------------------------------------------------------------------
;Spike Defeated
[Statedef 7003]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 1
sprpriority = 3

[State 7003, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7003, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7003, 3]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7003, 4]
type = DestroySelf
triggerall = Time
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L

;---------------------------------------------------------------------------
;Kraid Stand Summon (Idle)
[Statedef 7004]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7004
sprpriority = 3

[State 7004, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7004, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7004, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7004, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = PrevStateNo = 7030
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 7004, 5]
type = ChangeState
trigger1 = Time = 15
value = 7020

;---------------------------------------------------------------------------
;Kraid Crouch Summon (Entrance)
[Statedef 7010]
type    = A
movetype= I
physics = N
velset = Cond(root,FrontEdgeDist > 50,(ParentDist X+20)/15,(ParentDist X-20)/15),-3.83*const(size.yscale)
ctrl = 0
anim = 7000
sprpriority = 3

[State 7000, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7000, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7000, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7000, 4]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 7000, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7000, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7000, 7]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7000, 8]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7011
;---------------------------------------------------------------------------
;Kraid Crouch Summon (Throw)
[Statedef 7011]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7011
sprpriority = 3

[State 7011, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7011, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7011, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7030
time = -1

[State 7011, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7011, 5]
type = VarSet
trigger1 = Time = 9
fvar(3) = root,FVar(21)

[State 7011, 6]
type = Helper
trigger1 = Time = 9
name = "Horns"
ID = 7050
stateno = 7012
pos = ceil(-13*const(size.xscale)),ceil(-48*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7011, 7]
type = Helper
trigger1 = Time = 17
name = "Horns"
ID = 7051
stateno = 7012
pos = ceil(-28*const(size.xscale)),ceil(-29*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7011, 8]
type = ParentVarSet
trigger1 = Time = 9
var(39) = 1

[State 7011, 9]
type = VarAdd
trigger1 = Time = 9 || Time = 17
var(11) = 1

[State 7011, 10]
type = PosSet
trigger1 = !Time
y = 0

[State 7011, 11]
type = ChangeState
trigger1 = !AnimTime
value = 7004
;---------------------------------------------------------------------------
;Kraid Crouch Summon (Horns)
[Statedef 7012]
type    = S
movetype= A
physics = N
velset = 3.2*const(size.xscale),-11.5*const(size.yscale)
ctrl = 0
anim = 7012
sprpriority = 3

[State 7002, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1

[State 7002, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7003
time = -1

[State 7012, 3]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 7012, 4]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(35*parent,Fvar(3)),9
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -6.2*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
;fall = 1
;fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7012, 5]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(!Var(26), Var(26) := 3,0)
ignorehitpause = 1

[State 7012, 6]
type = Explod
triggerall = NumTarget && MoveHit
trigger1 = !(target,Time)
anim = 6001
ID = 7100
pos = ceil(-1*const(size.xscale)),ceil(1*const(size.yscale))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 7012,7]
type = PlaySnd
trigger1 = NumTarget && MoveHit
trigger1 = !(target,Time)
value = F5,1
ignorehitpause = 1

[State 7012, 8]
type = ParentVarAdd
trigger1 = HitPauseTime = 1
var(2) = 1
ignorehitpause = 1

[State 7012, 9]
type = ParentVarAdd
triggerall = NumTarget && MoveHit
trigger1 =  HitPauseTime = 1
var(2) = 1
ignorehitpause = 1

[State 7012, 10]
type = PlaySnd
trigger1 = !Time
value = S7010,0

[State 7012, 11]
type = ChangeState
trigger1 = Pos Y > 50 && !NumTarget
trigger2 = NumTarget
trigger2 = target,StateType = L
value = 7003
;---------------------------------------------------------------------------
;Kraid Leave
[Statedef 7020]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 7020
sprpriority = 3

[State 7020, 1]
type = Turn
trigger1 = !Time

[State 7020, 2]
type = ScreenBound
trigger1 = 1
value = 0

[State 7020, 3]
type = PlayerPush
trigger1 = 1
value = 0

[State 7020, 4]
type = VelSet
trigger1 = !Time
x = 4.2*const(size.xscale)

[State 7020, 5]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = -1

[State 7020, 6]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
;Kraid Hit
[Statedef 7030]
type    = A
movetype= H
physics = N
velset = -1.5*const(size.xscale),0
ctrl = 0
anim = 7030
sprpriority = 3

[State 7030, 1]
type = ParentVarAdd
trigger1 = !Time 
var(6) = -100
ignorehitpause = 1

[State 7030, 2]
type = PlaySnd
trigger1 = !Time
value = S7030,0

[State 7030, 3]
type = VelAdd
trigger1 = Pos Y < 0
y = .44*const(size.yscale)

[State 7030, 4]
type = VelSet
trigger1 = Pos Y >= 0
y = 0

[State 7030, 4]
type = PosSet
trigger1 = Pos Y >= 0
y = 0

[State 7030, 5]
type = ChangeState
trigger1 = Time >= 18 && Pos Y >= 0
value = 7004

[State 7030, 6]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7040

;---------------------------------------------------------------------------
;Kraid Defeated
[Statedef 7040]
type    = L
movetype= H
physics = N
sprpriority = 3
velset = 0,0
anim = 1
ctrl = 0

[State 5400, 5]
type = Explod
trigger1 = !Time
anim = 7040
ID = 7040
pos = ceil(13*const(size.xscale)),ceil(-39*const(size.yscale))
postype = p1
vel = 3.13*const(size.xscale),-2.66*const(size.yscale)
accel = 0,0.26
removetime = 60
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1
removeongethit = 0

[State 5400, 6]
type = Explod
trigger1 = !Time
anim = 7041
ID = 7040
pos = ceil(13*const(size.xscale)),ceil(-56*const(size.yscale))
postype = p1
vel = 3.13*const(size.xscale),-1.66*const(size.yscale)
accel = 0,0.2
removetime = 60
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1
removeongethit = 0

[State 5400, 7]
type = Explod
trigger1 = !Time
anim = 7042
ID = 7040
pos = ceil(13*const(size.xscale)),ceil(-31*const(size.yscale))
postype = p1
vel = 3.13*const(size.xscale),-1.06*const(size.yscale)
accel = 0,0.16
removetime = 60
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1
removeongethit = 0

[State 5400, 8]
type = Explod
trigger1 = !Time
anim = 7043
ID = 7040
pos = ceil(-13*const(size.xscale)),ceil(-56*const(size.yscale))
postype = p1
vel = -3.13*const(size.xscale),-2.66*const(size.yscale)
accel = 0,0.26
removetime = 60
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1
removeongethit = 0

[State 5400, 9]
type = Explod
trigger1 = !Time
anim = 7044
ID = 7040
pos = ceil(-13*const(size.xscale)),ceil(-39*const(size.yscale))
postype = p1
vel = -3.13*const(size.xscale),-1.66*const(size.yscale)
accel = 0,0.2
removetime = 60
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1
removeongethit = 0

[State 5400, 10]
type = Explod
trigger1 = !Time
anim = 7045
ID = 7040
pos = ceil(-13*const(size.xscale)),ceil(-31*const(size.yscale))
postype = p1
vel = -3.13*const(size.xscale),-1.06*const(size.yscale)
accel = 0,0.16
removetime = 60
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ownpal = 1
removeongethit = 0

[State 7040, 4]
type = ChangeState
trigger1 = Time = 1
value = 7300
;---------------------------------------------------------------------------
;Pit Stand Summon (Entrance)
[Statedef 7100]
type    = A
movetype= I
physics = N
velset = Cond(root,FrontEdgeDist > 50,(ParentDist X+20)/15,(ParentDist X-20)/15),-3.83*const(size.yscale)
ctrl = 0
anim = 7100
sprpriority = 3

[State 7100, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7100, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7100, 3]
type = Null
trigger1 = !Time
var(7) = -100-(50*(root,Var(0) > 0))

[State 7100, 4]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 7100, 5]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 6]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7100, 7]
type = PlaySnd
trigger1 = Animelem = 2
value = S7100,0

[State 7000, 8]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7100, 9]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 7101
;---------------------------------------------------------------------------
;Pit Stand Summon (Arrow Shot)
[Statedef 7101]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7101
sprpriority = 3

[State 7100, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7100, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7100, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7100, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7100, 5]
type = PosSet
trigger1 = !Time
y = 0

[State 7100, 6]
type = Helper
trigger1 = AnimElem = 5 
name = "Arrow"
ID = 7050
stateno = 7102
pos = ceil(280*const(size.xscale)),ceil(-21*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7100, 7]
type = ParentVarSet
trigger1 = AnimElem = 5 
var(39) = 1

[State 7100, 8]
type = VarAdd
trigger1 = AnimElem = 5 
var(11) = 1

[State 7100, 9]
type = EnvColor
trigger1 = AnimElem = 5
value = 0,0,0
time = 1
under = 1

[State 7100, 10]
type = PlaySnd
trigger1 = AnimElem = 5 
value = S7100,1

[State 7100, 11]
type = ChangeState
trigger1 = !AnimTime
value = 7103
;---------------------------------------------------------------------------
;Pit Stand Summon (Arrow)
[Statedef 7102]
type    = S
movetype= A
physics = N
velset = 40,0
ctrl = 0
anim = 7102
sprpriority = 3

[State 7103, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7103, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7103, 3]
type = Null
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7103, 4]
type = Null
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7103, 3]
type = HitDef
trigger1 = !Time
attr = S, HP
damage = ceil(90*root,Fvar(21)),45
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
pausetime = 1,12
sparkno = -1
hitsound = F5, 4
guardsound = F6, 0
ground.type = High
ground.slidetime = 18
guard.slidetime = 18
ground.hittime  = 19
guard.hittime = 18
ground.velocity = 0,-10.8*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = 0,-8.6*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 7100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7103, 4]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1 && HitCount = 1
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7103, 5]
type = VarAdd
trigger1 = MoveHit = 1
var(1) = 1

[State 7103, 6]
type = ChangeState
trigger1 = Time >= 3 && !NumTarget
trigger2 = NumTarget
trigger2 = target,StateType = L
value = 7003
;---------------------------------------------------------------------------
;Pit Stand Summon (Recover)
[Statedef 7103]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7103
sprpriority = 3

[State 7103, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7103, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7103, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7103, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7103, 5]
type = ChangeState
trigger1 = !AnimTime
value = 7120
;---------------------------------------------------------------------------
;Pit Crouch Summon (Entrance)
[Statedef 7110]
type    = A
movetype= I
physics = N
velset = 3.5*const(size.xscale),0
ctrl = 0
anim = 7110
sprpriority = 3

[State 7110, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7110, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7110, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7110, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7110, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7110, 6]
type = Helper
trigger1 = !Time
name = "Shield"
ID = 7111
stateno = 7115
pos = 0,0
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7110, 7]
type = PosSet
trigger1 = !Time
y = -15*const(size.yscale)

[State 7110, 8]
type = PlaySnd
trigger1 = AnimElem = 2
value = S7100,0

[State 7110, 9]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7110, 10]
type = ChangeState
trigger1 = P2Dist X < 80
value = 7111
;---------------------------------------------------------------------------
;Pit Crouch Summon (Swing)
[Statedef 7111]
type    = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7112
sprpriority = 3

[State 7111, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7111, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7111, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7111, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 2
x = 9.5*const(size.xscale)

[State 7111, 5]
type = HitDef
trigger1 = !Time
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Medium
priority = 4,Hit
getpower = 0
damage = ceil(75*root,Fvar(21)),19
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9, ceil(-17*const(size.yscale))
hitsound = F5,3
guardsound = F6,0
ground.type = Low
ground.slidetime = 11
ground.hittime = 21
guard.hittime = 11
ground.velocity = -4.2*const(size.xscale), -2.4*const(size.yscale)
air.type = Low
air.hittime = 100
air.velocity = -4.3*const(size.xscale), -1.6*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7111, 6]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7111, 7]
type = VelMul
trigger1 = AnimElemTime(2) >= 0
x = .9 

[State 7111, 8]
type = PlaySnd
trigger1 = AnimElem = 2 
value = S7110,0

[State 7111, 9]
type = ChangeState
trigger1 = !AnimTime
value = 7112
;---------------------------------------------------------------------------
;Pit Crouch Summon (Attack)
[Statedef 7112]
type    = A
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7113
sprpriority = 3

[State 7112, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7112, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7112, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7130
time = -1

[State 7112, 4]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7112, 5]
type = ChangeState
trigger1 = !AnimTime
value = 7120
;---------------------------------------------------------------------------
;Shield
[Statedef 7115]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 7115
sprpriority = 3

[State 7205, 1]
type = BindToParent
trigger1 = 1
pos = 0+(8*(parent,StateNo = 7111 && parent,AnimElemTime(2) >= 0)),0

[State 7205, 2]
type = HitBy
trigger1 = 1
value = SCA,NP,SP
time = 1

[State 7205, 3]
type = HitOverride
trigger1 = 1
attr = SCA,NP,SP
stateno = 7115
time = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = parent,StateNo = 7112 && parent,AnimElem = 3
trigger2 = parent,StateNo != [7110,7112]

;---------------------------------------------------------------------------
;Pit Leave
[Statedef 7120]
type    = S
movetype= I
physics = N
velset = -3.5*const(size.xscale),0
ctrl = 0
anim = 7120
sprpriority = 3

[State 7120, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7120, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7120, 3]
type = Turn
trigger1 = !Time

[State 7120, 4]
type = PlaySnd
trigger1 = Animelem = 2
value = S7100,0

[State 7120, 5]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7300
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7130]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7130
sprpriority = 3

[State 7130, 1]
type = PosAdd
trigger1 = !Time
x = -15*const(size.xscale)

[State 7130, 2]
type = PlaySnd
trigger1 = !Time
value = S7130,0

[State 7130, 3]
type = ChangeState
trigger1 = Time = 16
value = 7131

[State 7130, 4]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 7130, 5]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7140
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 7131]
type    = S
movetype= H
physics = N
sprpriority = 3
ctrl = 0
anim = 7131

[State 7131, 1]
type = ChangeState
trigger1 = !AnimTime  
value = 7120
;---------------------------------------------------------------------------
;Pit Defeated
[Statedef 7140]
type    = L
movetype= H
physics = N
sprpriority = 3
velset = 0,0
anim = 7140
ctrl = 0

[State 7140, 1]
type = VelSet
trigger1 = Time = 20
y = 5.4*const(size.yscale)

[State 7140, 2]
type = PlaySnd
trigger1 = !Time
value = S7130,0

[State 7140, 3]
type = ChangeState
trigger1 = Pos Y > 100
value = 7300
;---------------------------------------------------------------------------
;Takamaru Stand Summon
[Statedef 7200]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 7200
sprpriority = 3

[State 7200, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7200, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7200, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7200, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7200, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7200, 6]
type = PosSet
trigger1 = !Time
x = (root,Pos X) - 20*(root,BackEdgeDist > 15)

[State 7200, 7]
type = HitDef
trigger1 = !Time
attr = S,NA
hitflag = MAF
guardflag = MA
animtype = Medium
priority = 4,Hit
getpower = 0
damage = ceil(125*root,Fvar(21)),32
pausetime = 1,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5,4
guardsound = F6,0
ground.type = Low
ground.slidetime = 13
ground.hittime = 19
guard.hittime = 19
ground.velocity = 0*const(size.xscale), -3.8*const(size.yscale)
air.type = Low
air.hittime = 100
air.velocity = 0, -3.2*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 240
fall = 1
fall.recover = 0
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7200, 8]
type = Null
triggerall = NumTarget && MoveHit
trigger1 = root,Cond(FVar(20) > .3, FVar(20) := FVar(20) - .2,0) || root,Cond(FVar(21) > .3, FVar(21) := FVar(21) - .2,0)
ignorehitpause = 1
persistent = 0

[State 7200, 9]
type = StateTypeSet
trigger1 = AnimElem = 7
movetype = A

[State 7200, 10]
type = PosAdd
trigger1 = AnimElem = 7
x = 115*const(size.xscale)

[State 7200, 11]
type = VelSet
trigger1 = AnimElem = 7
x = 4.6*const(size.xscale)

[State 7200, 12]
type = Explod
trigger1 = !Time
trigger2 = AnimElem = 13
anim = 7201
ID = 7000
pos = 0,0
postype = p1
scale = const(size.xscale),const(size.yscale)
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
pausemovetime = 0
sprpriority = 5
ownpal = 1

[State 7200, 13]
type = PlaySnd
trigger1 = !Time
trigger2 = AnimElem = 13
value = S7200,0

[State 7200, 14]
type = PlaySnd
trigger1 = AnimElem = 7
value = S7200,1

[State 7200, 15]
type = PlaySnd
trigger1 = AnimElem = 11
value = S7200,2

[State 7200, 16]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7200, 17]
type = ChangeState
trigger1 = !AnimTime
value = 7300
;---------------------------------------------------------------------------
;Takamaru Crouch Summon (Entrance)
[Statedef 7210]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 7210
sprpriority = 3

[State 7210, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7210, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7210, 3]
type = Null
trigger1 = !Time
var(7) = -50-(50*(root,Var(0) > 0))

[State 7210, 4]
type = HitOverride
trigger1 = 1
attr = SCA,NA,SA,HA,NP,SP,HP
stateno = 7230
time = -1

[State 7210, 5]
type = HitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP
time = -1

[State 7210, 6]
type = PosSet
trigger1 = !Time
x = (root,Pos X) + 20*(root,FrontEdgeDist > 50)

[State 7210, 7]
type = Helper
trigger1 = AnimElem = 5
name = "Flame (Horizontal)"
ID = 7050
stateno = 7211
pos = ceil(35*const(size.xscale)),ceil(-38*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7210, 8]
type = Helper
trigger1 = AnimElem = 5
name = "Flame (Diagonal)"
ID = 7051
stateno = 7213
pos = ceil(35*const(size.xscale)),ceil(-54*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7210, 9]
type = Explod
trigger1 = !Time
trigger2 = AnimElem = 7
anim = 7201
ID = 7000
pos = 0,0
postype = p1
scale = const(size.xscale),const(size.yscale)
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
pausemovetime = 0
sprpriority = 5
ownpal = 1

[State 7210, 10]
type = ParentVarSet
trigger1 = AnimElem = 5 
var(39) = 1

[State 7210, 11]
type = VarAdd
trigger1 = AnimElem = 5 
var(11) = 2

[State 7210, 12]
type = PlaySnd
trigger1 = !Time
trigger2 = AnimElem = 7
value = S7200,0

[State 7210, 13]
type = PlaySnd
trigger1 = AnimElem = 5
value = S7210,0

[State 7210, 14]
type = ParentVarSet
trigger1 = !Time && RoundState = 2
var(38) = 1

[State 7210, 15]
type = ChangeState
trigger1 = !AnimTime
value = 7300
;---------------------------------------------------------------------------
;Flame
[Statedef 7211]
type    = A
movetype= A
physics = N
velset = 5.86*const(size.xscale),0
ctrl = 0
anim = 7211
sprpriority = 3

[State 7211, 1]
type = NotHitBy
trigger1 = 1
value = ,AA,AT
time = -1

[State 7211, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7212
time = -1

[State 7211, 3]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(100*root,Fvar(21)),25
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5,3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -6.2*const(size.xscale), -3.1*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5*const(size.xscale),-2.8*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7211, 4]
type = Explod
triggerall = NumTarget && MoveHit
trigger1 = !(target,Time)
anim = 6001
ID = 7100
pos = ceil(-1*const(size.xscale)),ceil(1*const(size.yscale))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 7211, 5]
type = Null
triggerall = NumTarget && MoveHit && HitPauseTime = 1
trigger1 = root,Cond(!Var(26), Var(26) := 3,0)
ignorehitpause = 1

[State 7211, 6]
type = TargetState
trigger1 = NumTarget && MoveHit
trigger1 = !(target,Time)
value = 5400
ID = -1
ignorehitpause = 1

[State 7211, 7]
type = ChangeState
trigger1 = MoveContact
value = 7212

[State 7211, 8]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7212
;-------------------------------------------------------------------------
;Flame Dead
[Statedef 7212]
type    = S
movetype= I
physics = N
anim = 1
ctrl = 0
velset = 0,0

[State 7212, 1]
type = VarSet
trigger1 = MoveHit != 1
var(1) = 0
ignorehitpause = 1

[State 0, ParentVarAdd]
type = ParentVarAdd
trigger1 = !Time
var(10) = 1

[State 7212, 2]
type = DestroySelf
trigger1 = Time && !NumTarget
trigger2 = NumTarget
trigger2 = target,StateType = L 
;---------------------------------------------------------------------------
;Flame 2
[Statedef 7213]
type    = A
movetype= A
physics = N
velset = 5.86*const(size.xscale),-5.86*const(size.yscale)
ctrl = 0
anim = 7211
sprpriority = 3

[State 7213, 1]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1

[State 7213, 2]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 7212
time = -1

[State 7213, 3]
type = HitDef
trigger1 = !Time
attr = S, SP
damage = ceil(100*root,Fvar(21)),25
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5,3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 28
guard.hittime  = 10
ground.velocity = -6.2*const(size.xscale), -3.1*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -5*const(size.xscale),-2.8*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 7213, 4]
type = Explod
triggerall = NumTarget && MoveHit
trigger1 = !(target,Time)
anim = 6001
ID = 7100
pos = ceil(-1*const(size.xscale)),ceil(1*const(size.yscale))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 7213, 5]
type = TargetState
trigger1 = NumTarget && MoveHit
trigger1 = !(target,Time)
value = 5400
ID = -1
ignorehitpause = 1

[State 7213, 6]
type = ChangeState
trigger1 = MoveContact
value = 7212

[State 7213, 7]
type = ChangeState
trigger1 = FrontEdgeDist < -30
value = 7212
;---------------------------------------------------------------------------
;Takamaru Leave
[Statedef 7220]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 7220
sprpriority = 3

[State 7220, 1]
type = ScreenBound
trigger1 = 1
value = 0

[State 7220, 2]
type = PlayerPush
trigger1 = 1
value = 0

[State 7200, 3]
type = DestroySelf
trigger1 = 1
;---------------------------------------------------------------------------
;Takamaru Hit
[Statedef 7230]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0
anim = 7230
sprpriority = 3

[State 7230, 1]
type = PlaySnd
trigger1 = !Time
value = S7230,0 

[State 7230, 2]
type = Explod
trigger1 = Time = 36
anim = 7201
ID = 7000
pos = 0,0
postype = p1
scale = const(size.xscale),const(size.yscale)
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
pausemovetime = 0
sprpriority = 5
ownpal = 1

[State 7230, 3]
type = PlaySnd
trigger1 = Time = 36
value = S7200,0

[State 7230, 4]
type = ParentVarAdd
trigger1 = !Time 
var(6) =  -100
ignorehitpause = 1

[State 7230, 5]
type = ChangeState
trigger1 = root,Var(6) = 0
value = 7240

[State 7230, 6]
type = ChangeState
trigger1 = Time = 44
value = 7300
;---------------------------------------------------------------------------
;Takamaru Defeated
[Statedef 7240]
type    = L
movetype= H
physics = N
sprpriority = 3
velset = 0,0
anim = 7240
ctrl = 0

[State 7230, 1]
type = PlaySnd
trigger1 = !Time
value = S7240,0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 13
anim = 7241
ID = 7240
pos = ceil(2*const(size.xscale)),ceil(-35*const(size.yscale))
postype = p1 
scale = const(size.xscale),const(size.yscale)
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 3
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = Time = 120
id = 7240

[State 7240, 4]
type = ChangeState
trigger1 = Time = 120
value = 7300
;---------------------------------------------------------------------------
;Helper Gone
[Statedef 7300]
type    = U
movetype= H
physics = N
ctrl = 0
anim = 1
velset = 0,0
sprpriority = 3

[State 7300, 1]
type = ParentVarSet
trigger1 = Var(11) = Var(10)
var(39) = 0
ignorehitpause = 1

[State 7300, 2]
type = ParentVarSet
trigger1 = !Time
var(38) = 0
ignorehitpause = 1

[State 7300, 3]
type = DestroySelf
triggerall = !(root,Var(38)) && !(root,Var(39))
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
